package com.jushu.storbox.view.dialog;

import android.app.ProgressDialog;
import android.content.Context;

import com.jushu.storbox.R;

public class POPUPWindow {

	private Context context;
	ProgressDialog mProgressDialog;

	public POPUPWindow(Context context) {
		this.context = context;
	}

	public ProgressDialog show() {
		mProgressDialog = new ProgressDialog(context);
		mProgressDialog.setProgressStyle(ProgressDialog.STYLE_SPINNER);
		// mProgressDialog.setCancelable(false);
		mProgressDialog.setTitle(this.context.getResources().getString(R.string.please_wait));
		mProgressDialog.setMessage(this.context.getResources().getString(R.string.loading_data));
		mProgressDialog.setIndeterminateDrawable(context.getResources()
				.getDrawable(R.drawable.progressdialog_bg));
		mProgressDialog.show();
		return mProgressDialog;
	}

	public void hide() {
		if(mProgressDialog!=null){
			mProgressDialog.dismiss();
			mProgressDialog = null;
		}
	}
}